package day04;
//随机加法运算器
import java.util.Scanner;
public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score = 0;
        for(int i =1;i<=10;i++){
            //出题 答题 判题
        int a = (int)(Math.random()*100);
        int b = (int)(Math.random()*100);
            System.out.println("("+i+")"+a+"+"+b+"=?");
            int c = scan.nextInt();
            if (c==a+b) {
                score+=10;
                System.out.println("答对了");
            }else{
                System.out.println("答错了");
            }
        }
        System.out.println("得分："+score+"分");

    }
}
